package org.naxx.security.model.request;

import java.util.ArrayList;
import java.util.List;

import org.naxx.security.common.NotYetImplemented;

/**
 * Top level request object acting as placeholder for subjects, 
 * resources, action and environment composing the logical request.
 */
public final class Request {

	private List<Subject> subjects;
	private List<Resource> resources;
	private Action action;
	private Environment environment;
	
	public Request() {
		this.subjects = new ArrayList<Subject>();
		this.resources = new ArrayList<Resource>();
	}
	
	public void addSubject(Subject subject) {
		this.subjects.add(subject);
	}
	public void addResource(Resource resource) {
		this.resources.add(resource);
	}
	public Action getAction() {
		return this.action;
	}
	public void setAction(Action action) {
		this.action = action;
	}
	public Environment getEnvironment() {
		return this.environment;
	}
	public void setEnvironment(Environment environment) {
		this.environment = environment;
	}
	public List<Resource> getResources() {
		return this.resources;
	}
	public List<Subject> getSubjects() {
		return this.subjects;
	}
	public void setResources(List<Resource> resources) {
		this.resources = resources;
	}
	public void setSubjects(List<Subject> subjects) {
		this.subjects = subjects;
	}	

	@SuppressWarnings("unchecked")
	public List getActionAttributeValues(String attributeId) {
		throw new NotYetImplemented(Request.class.getName() + " getActionAttributeValues");
	}
	@SuppressWarnings("unchecked")
	public List getEnvironmentAttributeValues(String attributeId) {
		throw new NotYetImplemented(Request.class.getName() + " getEnvironmentAttributeValues");
	}
	@SuppressWarnings("unchecked")
	public List getResourceAttributeValues(String attributeId) {
		throw new NotYetImplemented(Request.class.getName() + " getResourceAttributeValues");
	}
	@SuppressWarnings("unchecked")
	public List getSubjectAttributeValues(String attributeId) {
		throw new NotYetImplemented(Request.class.getName() + " getSubjectAttributeValues");
	}
}
